import time

class Animation:
    def __init__(self, renderer):
        self.renderer = renderer
        
    def animate(self, animation):
        lastTime = time.time()
        while animation.play:
            currentTime = time.time()
            timeDelta = currentTime - lastTime
            lastTime = currentTime
            animation.step(timeDelta)
            renderer.render()